home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Essentials / Developer Essentials Nov 90 / Apple II / Apple.II.partition / Utilities / rTutors / part3.2 / rTutor.make2 < prev    next >
Encoding:
Text File  |  1990-06-19  |  3.1 KB  |  53 lines  |  [TEXT/pdos]

  1. * Just to be sure everybody gets to read all this stuff, let's turn on echo
  2. set echo on
  3. *
  4. * This exec file shows how to build resource forks without having to recompile
  5. * everything each time you want to add a new resource or change an existing
  6. * one.  This is accomplished by using the "include" (not the "#include", that
  7. * does something different) option of Rez.  We add the line "include rTutor.S16"
  8. * to the rTutor.new.rez file and then when we compile JUST the "rTutor.new.rez"
  9. * file, we can COMPLETELY recreate the entire resource fork!  Make some changes
  10. * to the other portions (besides the "include" line) of the rTutor.new.rez
  11. * file to verify for yourself what's happening.  Also, read pages 311 and 312
  12. * of the "Programming Tools & Interfaces for APW" manual for more details.
  13. * (those page numbers will change when the new "APW Tools & Interfaces"
  14. * package starts shipping- check your index when you get the new manual)
  15. *
  16. * Since Rez is very similar to C, I'll use conditional compilation to control
  17. * whether or not the existing resources get brought in.  This way, ONE file
  18. * can be used in TWO different ways.  The first way builds with the "-a" flag
  19. * and simply appends stuff to the existing resource fork and the second way
  20. * include's the existing stuff, then completely replaces it.  I've extended the
  21. * conditional compilation so that the contents of the app's "About" box will
  22. * be different based on which method was used.
  23. * (neat trick, eh?)
  24. *
  25. * Here's the first way (using "-a" on the compile line). We'll slam this
  26. * resource right down on the existing resource fork of the app itself.  I'm
  27. * assuming at this point that you've already run the other MAKE file and have
  28. * built the entire application already.  The "-d doFirstWay" on the command
  29. * line tells Rez to do the same thing it would do if it saw
  30. * "#define doFirstWay" in the rez source file itself.  I'm using "-d" on the
  31. * command line so that I don't have to tell you how to edit the file yourself.
  32. * This also shows how YOU can set up your source code so that different things
  33. * happen based on certain command line switches (you could use this to control
  34. * lots of things...)
  35. *
  36. compile rtutor.new.rez keep=rtutor.s16 rez=(-a -d doFirstWay)
  37. *
  38. * Now, run the app and look at the text in the About box.  Then, uncomment out
  39. * the next line, comment out the "compile rtutor.new.rez ..." ABOVE this line
  40. * and re-run this script.  This time, we have a DIFFERENT macro defined on
  41. * the command line, so the About box will say something different this time.
  42. * Since the "-a" flag is NOT being used this time, we'll be completly
  43. * overwriting the resource fork of the application.  We'll "include" all of the
  44. * existing resources from the "rTutor.rfork" file and changing the text of the
  45. * AlertWindow by overriding it in this file.  If you're lost by all of this,
  46. * post questions in the appropriate category/topic/folder (cat 14, topic 13 on
  47. * GEnie and "ADV:Programming Environments:Rez Tutorial" on America Online).
  48. *
  49. * (don't forget to remove the "*" at the start of the last line.  Otherwise,
  50. * you'll never see the second way demo'd)
  51. *
  52. * compile rtutor.new.rez keep=rtutor.s16 rez=(-d doSecondWay)
  53.